package com.github.edu.db.manager.config.entity;

import javax.persistence.*;
import java.util.Objects;

/**
 * Create by IntelliJ IDEA
 * 用户：王建
 * 日期：2018-7-30
 */
@Entity
@Table(name = "T_SYS_TABLE_FIELD")
public class TSysTableField {

    private String id;
    private String fieldId;
    private String tableName;
    private String fieldName;
    private Long fieldSize;
    private String fieldType;
    private String dataType;
    private String fieldComment;
    private String fieldDefault;
    private Long decimalDigits;
    private String isNullable;
    private String pkType;
    private String oldColumnName;
    private String controlType;
    private String isForm;
    private String isList;
    private String isQuery;
    private String isQueryType;
    private String isKey;
    private String relationTable;
    private String relationColumn;

    @Id
    @Column(name="ID")
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Basic
    @Column(name = "FIELD_ID")
    public String getFieldId() {
        return fieldId;
    }

    public void setFieldId(String fieldId) {
        this.fieldId = fieldId;
    }

    @Basic
    @Column(name = "TABLE_NAME")
    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    @Basic
    @Column(name = "FIELD_NAME")
    public String getFieldName() {
        return fieldName;
    }

    public void setFieldName(String fieldName) {
        this.fieldName = fieldName;
    }

    @Basic
    @Column(name = "FIELD_SIZE")
    public Long getFieldSize() {
        return fieldSize;
    }

    public void setFieldSize(Long fieldSize) {
        this.fieldSize = fieldSize;
    }

    @Basic
    @Column(name = "FIELD_TYPE")
    public String getFieldType() {
        return fieldType;
    }

    public void setFieldType(String fieldType) {
        this.fieldType = fieldType;
    }

    @Basic
    @Column(name = "DATA_TYPE")
    public String getDataType() {
        return dataType;
    }

    public void setDataType(String dataType) {
        this.dataType = dataType;
    }

    @Basic
    @Column(name = "FIELD_COMMENT")
    public String getFieldComment() {
        return fieldComment;
    }

    public void setFieldComment(String fieldComment) {
        this.fieldComment = fieldComment;
    }

    @Basic
    @Column(name = "FIELD_DEFAULT")
    public String getFieldDefault() {
        return fieldDefault;
    }

    public void setFieldDefault(String fieldDefault) {
        this.fieldDefault = fieldDefault;
    }

    @Basic
    @Column(name = "DECIMAL_DIGITS")
    public Long getDecimalDigits() {
        return decimalDigits;
    }

    public void setDecimalDigits(Long decimalDigits) {
        this.decimalDigits = decimalDigits;
    }

    @Basic
    @Column(name = "IS_NULLABLE")
    public String getIsNullable() {
        return isNullable;
    }

    public void setIsNullable(String isNullable) {
        this.isNullable = isNullable;
    }

    @Basic
    @Column(name = "PK_TYPE")
    public String getPkType() {
        return pkType;
    }

    public void setPkType(String pkType) {
        this.pkType = pkType;
    }

    @Basic
    @Column(name = "OLD_COLUMN_NAME")
    public String getOldColumnName() {
        return oldColumnName;
    }

    public void setOldColumnName(String oldColumnName) {
        this.oldColumnName = oldColumnName;
    }

    @Basic
    @Column(name = "CONTROL_TYPE")
    public String getControlType() {
        return controlType;
    }

    public void setControlType(String controlType) {
        this.controlType = controlType;
    }

    @Basic
    @Column(name = "IS_FORM")
    public String getIsForm() {
        return isForm;
    }

    public void setIsForm(String isForm) {
        this.isForm = isForm;
    }

    @Basic
    @Column(name = "IS_LIST")
    public String getIsList() {
        return isList;
    }

    public void setIsList(String isList) {
        this.isList = isList;
    }

    @Basic
    @Column(name = "IS_QUERY")
    public String getIsQuery() {
        return isQuery;
    }

    public void setIsQuery(String isQuery) {
        this.isQuery = isQuery;
    }

    @Basic
    @Column(name = "IS_QUERY_TYPE")
    public String getIsQueryType() {
        return isQueryType;
    }

    public void setIsQueryType(String isQueryType) {
        this.isQueryType = isQueryType;
    }

    @Basic
    @Column(name = "RELATION_TABLE")
    public String getRelationTable() {
        return relationTable;
    }

    public void setRelationTable(String relationTable) {
        this.relationTable = relationTable;
    }

    @Basic
    @Column(name = "RELATION_COLUMN")
    public String getRelationColumn() {
        return relationColumn;
    }

    public void setRelationColumn(String relationColumn) {
        this.relationColumn = relationColumn;
    }

    @Basic
    @Column(name = "IS_KEY")
    public String getIsKey() {
        return isKey;
    }

    public void setIsKey(String isKey) {
        this.isKey = isKey;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        TSysTableField that = (TSysTableField) o;
        return Objects.equals(fieldId, that.fieldId) &&
                Objects.equals(tableName, that.tableName) &&
                Objects.equals(fieldName, that.fieldName) &&
                Objects.equals(fieldSize, that.fieldSize) &&
                Objects.equals(fieldType, that.fieldType) &&
                Objects.equals(dataType, that.dataType) &&
                Objects.equals(fieldComment, that.fieldComment) &&
                Objects.equals(fieldDefault, that.fieldDefault) &&
                Objects.equals(decimalDigits, that.decimalDigits) &&
                Objects.equals(isNullable, that.isNullable) &&
                Objects.equals(pkType, that.pkType) &&
                Objects.equals(oldColumnName, that.oldColumnName) &&
                Objects.equals(controlType, that.controlType) &&
                Objects.equals(isForm, that.isForm) &&
                Objects.equals(isList, that.isList) &&
                Objects.equals(isQuery, that.isQuery) &&
                Objects.equals(isQueryType, that.isQueryType) &&
                Objects.equals(relationTable, that.relationTable) &&
                Objects.equals(relationColumn, that.relationColumn);
    }

    @Override
    public int hashCode() {
        return Objects.hash(fieldId, tableName, fieldName, fieldSize, fieldType, dataType, fieldComment, fieldDefault, decimalDigits, isNullable, pkType, oldColumnName, controlType, isForm, isList, isQuery, isQueryType, relationTable, relationColumn);
    }
}
